From: Sebastian Keller Date: Sat, 25 Oct 2025 11:03:55 +0000 (+0200) Subject: keyboard: Don't move window when it got unmanaged during shift animation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~156 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4900aad2deab7398e69b1a57a38285fa73974c0f;p=gnome-shell.git keyboard: Don't move window when it got unmanaged during shift animation When a window with a text-entry at the bottom that had triggered the OSK and was shifted up to avoid overlapping the OSK is closed right after losing keyboard focus, this results in a crash. The focus loss triggers the animation to move the window actor back into its original position, which moves the underlying window when finished. That however will fail when the window has been unmanaged and some of the underlying resources have already been destroyed while the animation was playing. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8752 Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e4efb18e0..06f925133 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1920,11 +1920,21 @@ export const Keyboard = GObject.registerClass({ ? this._focusWindowStartY - Main.layoutManager.keyboardBox.height : this._focusWindowStartY; + let unmanaged = false; + const winUnmanagedId = window.connect('unmanaged', () => { + unmanaged = true; + }); + windowActor.ease({ y: finalY, duration: KEYBOARD_ANIMATION_TIME, mode: Clutter.AnimationMode.EASE_OUT_QUAD, onStopped: () => { + window.disconnect(winUnmanagedId); + + if (unmanaged) + return; + windowActor.y = finalY; this._windowSlideAnimationComplete(window, finalY); },